from api.login_api import LoginApi


# def get_headers():
#     # 登录，返回包含令牌信息的请求头
#     body = {"mobile": "13800000002", "password": "123456"}
#     resp=LoginApi.login(body)
#     token="Bearer "+resp.json().get("data")
#     headers = {"Content-Type": "application/json",
#                "Authorization": token}
#     return headers     第一种方式

def get_headers(mobile="13800000002",password="123456"):
    # 登录，返回包含令牌信息的请求头
    body = {"mobile": mobile, "password": password}
    resp=LoginApi.login(body)
    token="Bearer "+resp.json().get("data")
    headers = {"Content-Type": "application/json",
               "Authorization": token}
    return headers     #第二种方式

